package com.group3.group3.baobiao.hrbor.service.impl;


import com.group3.group3.baobiao.hrbor.entity.HarborinfoSearchEnity;
import com.group3.group3.baobiao.hrbor.repository.HarborinfoDao;
import com.group3.group3.baobiao.hrbor.service.HarborinfoService;
import com.group3.group3.mybatis.entity.CoalHarborEntity;
import com.group3.group3.mybatis.flexigrid.PadingRstType;
import com.group3.group3.mybatis.flexigrid.PagingBean;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Hhw-byte
 * @create 2022-05-16 11:10
 */
@Service("HarborinfoService")
class HarborinfoServiceImpl implements HarborinfoService {

    @Resource//将UserDao注入进来，就可以通过userDao访问UserDao接口中的方法
    private HarborinfoDao harborinfoDao;
    @Override
    public PadingRstType<CoalHarborEntity> getharborinfoInfoListByPage(HarborinfoSearchEnity search, PagingBean paging) {
        paging.deal(CoalHarborEntity.class);
        PadingRstType<CoalHarborEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(paging.getPage());
        List<CoalHarborEntity> list = harborinfoDao.queryHarborinfoListByPage(search,paging);
        Integer total = harborinfoDao.queryHarborinfoListTotal(search);
        padingRstType.setRawRecords(list);
        padingRstType.setTotal(total);
        padingRstType.putItems();
        return padingRstType;
    }
}